// eslint-disable-next-line
import { UserLayout, BasicLayout, BlankLayout } from '@/layouts'

const RouteView = {
  name: 'RouteView',
  render: h => h('router-view')
}
export const asyncRouterMap = [
  {
    path: '/',
    component: BasicLayout,
    meta: { title: '主页' },
    redirect: '/goods/managements/index',
    children: [
      {
        path: '/goods',
        name: 'goods',
        component: RouteView,
        meta: { title: '商品列表', icon: 'table', userTypeList:['ydiandajifen1']},
        children: [
          {
            path: '/goods/managements/index',
            name: 'managements',
            component: () => import('@/views/goods/managements/index'),
            meta: { title: '商品列表', userTypeList:['ydiandajifen1']}
          },
          // {
          //   path: '/orderDetails/statistics/index',
          //   name: 'statistics',
          //   component: () => import('@/views/orderDetails/statistics/index'),
          //   meta: { title: '订单统计', userTypeList:['setsystemindex1']}
          // }
        ]
      },
      {
        path: '/orderDetails',
        name: 'orderDetails',
        component: RouteView,
        redirect: '/orderDetails/label/index',
        meta: { title: '订单列表', icon: 'table', userTypeList:['ydiandajifen1']},
        children: [
          {
            path: '/orderDetails/statistics/index',
            name: 'statistics',
            component: () => import('@/views/orderDetails/statistics/index'),
            meta: { title: '订单统计', userTypeList:['ydiandajifen1']}
          },
          {
            path: '/orderDetails/orderList/index',
            name: 'orderList',
            component: () => import('@/views/orderDetails/orderList/index'),
            meta: { title: '订单列表', userTypeList:['ydiandajifen1']}
          },
        ]
      },
      
      {
        path: '/information',
        name: 'information',
        component: RouteView,
        redirect: '/information/informations/index',
        meta: { title: '商户信息', icon: 'table', userTypeList:['ydiandajifen1']},
        children: [
          {
            path: '/information/informations/index',
            name: 'informations',
            component: () => import('@/views/information/informations/index'),
            meta: { title: '商户信息', userTypeList:['ydiandajifen1']}
          },
          {
            path: '/information/addmoney/index',
            name: 'addmoney',
            component: () => import('@/views/information/addmoney/index'),
            meta: { title: '余额充值', userTypeList:['ydiandajifen1']}
          },
          {
            path: '/information/balance/index',
            name: 'balance',
            component: () => import('@/views/information/balance/index'),
            meta: { title: '余额明细', userTypeList:['ydiandajifen1']}
          }
        ]
      },
    ]
  },
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import('@/views/user/Login')
      },
      {
        path: 'register',
        name: 'register',
        component: () => import('@/views/user/Register')
      },
      {
        path: 'register-result',
        name: 'registerResult',
        component: () => import('@/views/user/RegisterResult')
      }
    ]
  },
]
